.PHONY: all run clean latest $(ALL)

ALL = $(basename $(notdir $(shell find tests/. -name "*.c")))

all: $(addprefix Makefile., $(ALL))
	@echo "" $(ALL)

$(ALL): %: Makefile.%

Makefile.%: tests/%.c latest
	@echo '去${AM_HOME}/Makefile取消@可以看elf和bin怎么生成的'
	/bin/echo -e "NAME = $*\nSRCS = $<\nLIBS += klib\ninclude $${AM_HOME}/Makefile" > $@
	@echo '产生快乐'
	-make -f $@ ARCH=$(ARCH) $(MAKECMDGOALS) #删掉-s是为了多一些输出
	@echo
	#这条不执行-rm -f Makefile.$*

run: all

clean:
	rm -rf Makefile.* build/

latest:
